Blogging Prompts: Add Core Data model and adjust service - #18607
Conversation
- Upsert remote prompts to Core Data. - Adjust prompts card cell to display actual today's prompt. - Adjust prompts intro presenter to show actual today's prompt. - Adjust CreateButtonCoordinator to show local today's prompt.
Generated by 🚫 dangerJS |
|
I'm pretty sure I've resolved the conflicts in d621615... 😅 . Giving it another go. |
You can test the changes in WordPress from this Pull Request by:
|
You can test the changes in Jetpack from this Pull Request by:
|
|
@ScoutHarris Ah, I see... I'm pretty sure this is a timezone issue. Since the dates under test are in UTC, calling I'll post a fix soon! Thanks for noticing this. 🙇🏼 UPDATE: Should be addressed in c3ca003 |
|
I saw one issue. I don't think it's related to this PR, but noting it here just in case. The dashboard card doesn't update with the latest prompt. The compact card does, as does the prompts list, but the dashboard card still displays the previous prompts. I haven't looked, but I think it's related to Leandro's explanation of why pull-to-refresh doesn't update the card.
|
ScoutHarris
left a comment
There was a problem hiding this comment.
Considering the size of changes and the fact that this touches Core Data, I'm thinking to target this for 20.0.
I tend to agree. I don't see any PRs (at this time) that change the model, so should be ok until post-freeze. 🤞
(eventually 😄 )
|
Thanks @ScoutHarris ! |



Refs #18375
So... it's a pretty big chunk of changes. But most of it is Core Data, I promise! 😆 I originally intended to split the PR between adding just the Core Data model, and adding the changes to the
BloggingPromptsService— but there's a naming conflict between the temporary model and the Core Data model so I decided to just fix it in one go.A couple of notes about the changes:
BloggingPromptis now a Core Data model.siteIDfield toBloggingPromptsince the user can access multiple sites — but there shouldn't be any impact on the UI side since this has been handled internally inBloggingPromptsService. Just make sure that you're always getting the prompts from the service, or remember to addsiteIDwhen fetching the model directly.promptAttributionthat returnsBloggingPromptsAttribution.examplePrompt, I've replaced the calls with thepromptinstance variable inDashboardPromptCardCell, andCreateButtonCoordinator.BloggingPromptsService, it now properly creates new objects and/or updates existing ones.localTodaysPromptmethod which synchronously fetches today's prompt from Core Data. I'm sure there's a use case for this somewhere.To Test
Unit tests ⚙️
Make sure that the unit tests are passing.
Manual tests 👀
Regression Notes
Potential unintended areas of impact
N/A. Feature is not released yet.
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A. Feature is not released yet.
What automated tests I added (or what prevented me from doing so)
Added unit tests for object mapping and date filtering.
PR submission checklist:
RELEASE-NOTES.txtif necessary.